home *** CD-ROM | disk | FTP | other *** search
- ############################################################################
- # #
- # dbase3.rul -- Decode It! rule file for dBASE III DBF files #
- # (dBASE is a registered trademark of Borland International) #
- # #
- # Please note: This rule file is provided as an example only. While #
- # every effort has been made to validate the information #
- # presented here, Axiom Innovations takes no responsibility #
- # for the integrity of the data that results from using #
- # this example. #
- # #
- ############################################################################
-
- # dBASE III Header area
- RECORD Header
-
- # Version should be equal to 3 or -125
- XTINY Version
-
- WHILE Header.Version <> 3
- BEGIN
-
- WHILE Header.Version <> -125
- EXIT
-
- END
-
- # Year of last edit date
- TINY Year
-
- # Month of last edit date
- TINY Month
-
- # Day of last edit date
- TINY Day
-
- # Number of records in the database
- LONG Record_Number
-
- # Length of header area
- SHORT Header_Length
-
- # Record size in bytes
- SHORT Record_Size
-
- # Reserved
- TINY Reserved 20
- (OMIT0) Header.Reserved
-
- END
-
-
- # Field definitions
- WHILE .OFFSET < Header.Header_Length
- RECORD Field -1
-
- # Field name, left justified, zero-filled
- WHILE Field.Name <> 13
- ASCII Name 11
- (OMIT0) Field.Name
-
- # CR is the End of Fields marker
- WHILE Field.Name <=> 13
- BREAK
-
- # Field type: C, N, L, D, or M
- ASCII Type
-
- # Field data address (not very useful).
- XLONG Address
-
- # Field length
- TINY Length
-
- # Number of decimals
- TINY Decimal_Digits
-
- # Reserved
- TINY Reserved 14
- (OMIT0) Field.Reserved
-
- END
-
-
- WHILE .OFFSET < Header.Header_Length
- TINY unused -1
- (OMIT0) unused
-
- # Actual database
- RECORD DBASE3_Record Header.Record_Number
-
- # Deleted records contain an asterisk ('*') in first byte
- # Normal records contain a space in first byte
- ASCII Deleted_Flag
-
- ASCII Info -1
-
- END Header.Record_Size
-
-
- # End of file
- TINY EndOfFile
-
-
- EXIT
-
-